#include "launcher.h"
#include "tools.h"
#include "UpdateChecker.h"
#include <QtGui/QApplication>


int main(int argc, char *argv[])
{
	int exitCode = 0;

	QApplication application(argc, argv);
	UpdateChecker checker;
	Launcher launcherProgressWindow;

	launcherProgressWindow.connect( &checker, SIGNAL(downloadEXEStarted()), &launcherProgressWindow, SLOT(show()) );
	launcherProgressWindow.connect( &checker, SIGNAL(downloadEXEProgress(qint64, qint64)), &launcherProgressWindow, SLOT(setDownloadProgress(qint64, qint64)) );
	launcherProgressWindow.connect( &checker, SIGNAL(downloadEXEFinished()), &launcherProgressWindow, SLOT(hide()) );

	checker.beginToDownloadUpdateXML("http://dl.dropbox.com/u/71173138/update.xml");
	exitCode = application.exec();

	return exitCode;
}
